<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="//unpkg.com/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        {{ msgChange() }}
        <!-- 字符串倒置操作 reverse（）是倒置数组  join（）是拼接 -->
    </div>

    <script>
        let vue = new Vue({
            el: "#app",
            data: {
                msg: 'hello Vue!'
            },
            methods: {
                msgChange : function () {
                    return this.msg.split('').reverse().join('')
                }
            },

            // 计算属性的调用
            computed: {
                msgChange : function () {
                    return this.msg.split('').reverse().join('')
                }
            }
        })
    </script>
</body>

</html>